package day1023;

/**
 * @Author:galaxy_yan
 * @Date: 2022/10/23
 * @Time: 12:03
 * @Description
 */
public class Demo1 {
    public static void main(String[] args) {
        LinkedList list=new LinkedList();
        System.out.println("头插法测试：");
        list.addFirst(55);
        list.addFirst(44);
        list.addFirst(33);
        list.display();
        System.out.println("尾插法测试");
        list.addLast(66);
        list.addLast(77);
        list.addLast(88);
        list.addLast(55);
        list.display();

        System.out.println("中间插入测试");
        list.addIndex(1,22);
        list.addIndex(5,55);
        list.display();

        System.out.println("删除元素测试：");
        list.remove(55);
        list.display();

        System.out.println("删除所有元素测试");
        list.removeAllKey(55);
        list.display();

        System.out.println("包含key测试：");
        System.out.println(list.contains(55));
        System.out.println(list.contains(66));
    }
}
